package top.zackyoung.ssm.dao;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @author: ZackYoung
 * @time: 2020/9/10
 */
@Repository
public class DemoDao {
    @Autowired
    private JdbcTemplate jdbcTemplate;
    public List<Map<String,Object>> queryUser(){
        List<Map<String, Object>> query = jdbcTemplate.queryForList("select * from user as u inner join user_role as r on r.role_id=u.role_id");
        return query;
    }
}
